home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / workbench werkzeuge / workbench erweiterungen / shellbench / shellbench.install < prev    next >
Text File  |  1996-04-07  |  8KB  |  311 lines

  1. ; *************************************************************************
  2. ; *******************  SHELLBENCH INSTALLATION SCRIPT  ********************
  3. ; *************************************************************************
  4. ;
  5. ; $VER: ShellBench.install 1.2 (22.12.95)
  6. ;
  7. ; Copyright ©1995 Nick Christie
  8. ;
  9. ; *************************************************************************
  10. ;
  11. ; Find out about program version, etc
  12.  
  13. ; get version of SB in distribution
  14. (set vernum-sb (getversion "ShellBench"))
  15. (set ver-sb    (/ vernum-sb 65536))
  16. (set rev-sb    (- vernum-sb (* ver-sb 65536) ) )
  17.  
  18. (set @default-dest "")
  19. (set defsbdir "SYS:WBStartup")
  20. (set catsdir "Locale:Catalogs")
  21.  
  22. ; if novice user-level, bump up to average
  23. (if (= 0 @user-level)
  24.     (
  25.     (set @user-level 1)
  26.     (user 1)
  27.     )
  28. )
  29.  
  30. (set old-user-level @user-level)
  31.  
  32. ; ************************************************************************
  33. ; English strings
  34. ; ************************************************************************
  35.  
  36. (set default_lang 1)
  37.  
  38. (set #yes-msg "Yes")
  39.  
  40. (set #no-msg "No")
  41.  
  42. (set #bad-kick-msg "ShellBench requires AmigaOS 2.04 or better!")
  43.  
  44. (set #hello-msg
  45.     (cat
  46.         ("Welcome to ShellBench V%ld.%ld\n\n" ver-sb rev-sb)
  47.         "This script will install ShellBench and "
  48.         "related files on your Amiga.\n\n"
  49.         "You will need to answer a few questions such as "
  50.         "where you would like the program installed.\n\n"
  51.         "If you do not wish to install ShellBench at this time, "
  52.         "select the 'Abort Install' button now. "
  53.     )
  54. )
  55.  
  56. (set #sb-askdir-msg "Please select the directory to install ShellBench in.")
  57.  
  58. (set #sbguide "ShellBench.guide")
  59.  
  60. (set #sbguide-ask-msg
  61.     (cat
  62.         "\nInstall ShellBench documentation?\n\n"
  63.         "(This is an AmigaGuide file, and you will be asked "
  64.         "for the directory in which to install it.)\n\n"
  65.         "I recommend installing this, and reading it too, "
  66.         "so that you know how to utilitise ShellBench to "
  67.         "its fullest."
  68.     )
  69. )
  70.  
  71. (set #sbguide-askdir-msg
  72.     (cat
  73.         "\nPlease select the directory "
  74.         "to install ShellBench.guide in.\n"
  75.     )
  76. )
  77.  
  78. (set #guide-help
  79.     (cat
  80.         "AmigaGuide is the Amiga's standard hypertext format.\n\n"
  81.         "If you have AmigaOS 3.0 or better, you can use MultiView "
  82.         "to read this documentation, otherwise you must use the AmigaGuide "
  83.         "program, which is available on AmiNet and Fred Fish disk #870.\n\n"
  84.         "Both of these viewer programs have a 'search path', a set "
  85.         "of directories they search for AmigaGuide documents. "
  86.         "You should place this guide somewhere in that path."
  87.     )
  88. )
  89.  
  90. (set #locale-msg
  91.     (cat
  92.         "\nShellBench is localized, which means you may use "
  93.         "the program in several different languages. "
  94.         "Please choose your preferred languages.\n"
  95.     )
  96. )
  97.  
  98. (set #locale-help
  99.     (cat
  100.         "These are the languages supported by ShellBench.\n\n"
  101.         "Simply specify the languages you prefer and the "
  102.         "required catalog files will be copied to the "
  103.         "Locale:Catalogs directory.\n\nThis feature is "
  104.         "only available under AmigaOS 2.1 and later."
  105.     )
  106. )
  107.  
  108. ; ************************************************************************
  109. ; xxxx strings - template for other languages
  110. ; ************************************************************************
  111.  
  112. (if (= @language "xxxx")            ; fill in language name
  113.     (
  114.     (set default_lang x)            ; I will fill this in
  115.  
  116.     (set #yes-msg "Yes")
  117.  
  118.     (set #no-msg "No")
  119.  
  120.     (set #bad-kick-msg "ShellBench requires AmigaOS 2.04 or better!")
  121.  
  122.     (set #hello-msg
  123.         (cat
  124.             ("Welcome to ShellBench V%ld.%ld\n\n" ver-sb rev-sb)
  125.             "This script will install ShellBench and "
  126.             "related files on your Amiga.\n\n"
  127.             "You will need to answer a few questions such as "
  128.             "where you would like the program installed.\n\n"
  129.             "If you do not wish to install ShellBench at this time, "
  130.             "select the 'Abort Install' button now. "
  131.         )
  132.     )
  133.  
  134.     (set #sb-askdir-msg "Please select the directory to install ShellBench in.")
  135.  
  136. ; if guide is translated, uncomment second line & fill in language
  137. ;    (set #sbguide "ShellBench.guide")
  138. ;    (set #sbguide "/Guides/xxxx/ShellBench.guide")
  139.  
  140.     (set #sbguide-ask-msg
  141.         (cat
  142.             "\nInstall ShellBench documentation?\n\n"
  143.             "(This is an AmigaGuide file, and you will be asked "
  144.             "for the directory in which to install it.)\n\n"
  145.             "I recommend installing this, and reading it too, "
  146.             "so that you know how to utilitise ShellBench to "
  147.             "its fullest."
  148.         )
  149.     )
  150.  
  151.     (set #sbguide-askdir-msg
  152.         (cat
  153.             "\nPlease select the directory "
  154.             "to install ShellBench.guide in.\n"
  155.         )
  156.     )
  157.  
  158.     (set #guide-help
  159.         (cat
  160.             "AmigaGuide is the Amiga's standard hypertext format.\n\n"
  161.             "If you have AmigaOS 3.0 or better, you can use MultiView "
  162.             "to read this documentation, otherwise you must use the AmigaGuide "
  163.             "program, which is available on AmiNet and Fred Fish disk #870.\n\n"
  164.             "Both of these viewer programs have a 'search path', a set "
  165.             "of directories they search for AmigaGuide documents. "
  166.             "You should place this guide somewhere in that path."
  167.         )
  168.     )
  169.  
  170.     (set #locale-msg
  171.         (cat
  172.             "\nShellBench is localized, which means you may use "
  173.             "the program in several different languages. "
  174.             "Please choose your preferred languages.\n"
  175.         )
  176.     )
  177.  
  178.     (set #locale-help
  179.         (cat
  180.             "These are the languages supported by ShellBench.\n\n"
  181.             "Simply specify the languages you prefer and the "
  182.             "required catalog files will be copied to the "
  183.             "Locale:Catalogs directory.\n\nThis feature is "
  184.             "only available under AmigaOS 2.1 and later."
  185.         )
  186.     )
  187.     ) ; endif xxxx language
  188. )
  189.  
  190. ; ************************************************************************
  191. ; Begin actual installation
  192. ; ************************************************************************
  193.  
  194. ; Check for KickV37 or better
  195.  
  196. (if (< (/ (getversion) 65536) 37)
  197.     (
  198.     (abort #bad-kick-msg)
  199.     )
  200. )
  201.  
  202. ; ------------------------------------------------------------------------
  203. ; Show welcome msg
  204.  
  205. (user 2)
  206. (message #hello-msg)
  207. (user old-user-level)
  208.  
  209. ; ------------------------------------------------------------------------
  210. ; Ask the user where we should install ShellBench and copy the program.
  211.  
  212. (if
  213.     (set sbdir
  214.         (askdir
  215.             (prompt #sb-askdir-msg)
  216.             (help @askdir-help)
  217.             (default defsbdir)
  218.         )
  219.     )
  220.     (
  221.     (copyfiles (source "ShellBench") (dest sbdir) (infos) )
  222.     )
  223. )
  224.  
  225. (set @default-dest sbdir)
  226.  
  227. ; ------------------------------------------------------------------------
  228. ; Install ShellBench.guide. Ask yes/no first, then ask for directory.
  229. ; If installed, set GUIDENAME tooltype of ShellBench.
  230.  
  231. (set guidedir sbdir)
  232.  
  233. (if (askbool
  234.         (prompt #sbguide-ask-msg)
  235.         (help #guide-help)
  236.         (default 1)
  237.         (choices #yes-msg #no-msg)
  238.     )
  239.     ; then
  240.     (
  241.     (set guidedir
  242.         (askdir
  243.             (prompt #sbguide-askdir-msg)
  244.             (help @askdir-help)
  245.             (default guidedir)
  246.         )
  247.     )
  248.     (copyfiles (source #sbguide) (dest guidedir) (infos) )
  249.     (tooltype
  250.         (dest (tackon sbdir "ShellBench"))
  251.         (settooltype "GUIDENAME" (tackon guidedir "ShellBench.guide"))
  252.     )
  253.     )
  254. )
  255.  
  256. ;------------------------------------------------------------------------
  257. ; install catalog(s)
  258. ;
  259.  
  260. (if (exists "libs:locale.library")
  261.     (
  262.     (if (exists catsdir)
  263.         (
  264.         (user 2)
  265.         (set lang
  266.             (askoptions
  267.                 (prompt #locale-msg)
  268.                 (help #locale-help)
  269.                 (choices
  270.                     "English"
  271.                     "Français"
  272.                     "Italiano"
  273.                 )
  274.                 (default default_lang)
  275.             )
  276.         )
  277.         (user old-user-level)
  278.         (set n 0)
  279.         (while
  280.             (set language
  281.                 (select n
  282.                     "English"
  283.                     "Français"
  284.                     "Italiano"
  285.                     ""
  286.                 )
  287.             )
  288.             (
  289.                 (if (in lang n)
  290.                     (
  291.                     (if (<> 0 n)
  292.                         (
  293.                         (makedir (cat catsdir "/" language))
  294.                         (copyfiles
  295.                             (source (cat "Catalogs/" language "/ShellBench.catalog"))
  296.                             (dest (cat catsdir "/" language))
  297.                         )
  298.                         )
  299.                     )
  300.                     )
  301.                 )
  302.                 (set n (+ n 1))
  303.             )
  304.         ) ; endwhile pick language n
  305.         ) ; endthen
  306.     ) ; endif exists catsdir
  307.     ) ; endthen
  308.  
  309. ) ; endif exists locale lib
  310.  
  311.